<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

/*Route::get('/', function () {
    return view('welcome');
});*/

Route::get('/', 'LoginController@index');
Route::post('/dologin', 'LoginController@dologin');

Route::group(['middleware' => 'checklogin'], function () {

    //用户管理相关操作
    Route::post('/user/del', 'UserController@del');
    Route::post('/user/disable', 'UserController@disable');
    Route::get('/user/show', 'UserController@show');
    Route::post('/user/add', 'UserController@add');
    Route::post('/user/edit', 'UserController@edit');
    Route::get('/user', 'UserController@index');
    Route::get('/user/modpass', 'UserController@modpass');
    Route::post('/user/domodpass', 'UserController@domodpass');


    //角色管理相关操作
    Route::get('/role', 'RoleController@index');
    Route::get('/role/show', 'RoleController@show');
    Route::post('/role/add', 'RoleController@add');
    Route::post('/role/edit', 'RoleController@edit');
    Route::post('/role/del', 'RoleController@del');
    Route::get('/role/grant', 'RoleController@grant');
    Route::post('/role/dogrant', 'RoleController@dogrant');
    Route::post('/role/disable', 'RoleController@disable');

    Route::get('/main', 'MainController@index');

    Route::get('/menu', 'MenuController@index');
    Route::get('/menu/show', 'MenuController@show');
    Route::get('/menu/icon', 'MenuController@icon');
    Route::post('/menu/add', 'MenuController@add');
    Route::post('/menu/edit', 'MenuController@edit');
    Route::post('/menu/del', 'MenuController@del');
    Route::post('/menu/disable', 'MenuController@disable');


    Route::get('/log', 'LogController@index');
    Route::get('/logout', 'LoginController@logout');
    Route::get('404', function () {
        return view('404');
    });
    Route::get('405', function () {
        return view('405');
    });


    Route::fallback(function () {
        return view('404');
    });
});










